
class ChatDataList {
  int? code;
  String? msg;
  SingleChatData? data;

  ChatDataList({this.code, this.msg, this.data});

  ChatDataList.fromJson(Map<String, dynamic> json) {
    if(json["code"] is int) {
      code = json["code"];
    }
    if(json["msg"] is String) {
      msg = json["msg"];
    }
    if(json["data"] is Map) {
      data = json["data"] == null ? null : SingleChatData.fromJson(json["data"]);
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["code"] = code;
    _data["msg"] = msg;
    if(data != null) {
      _data["data"] = data?.toJson();
    }
    return _data;
  }
}

class SingleChatData {
  String? patientAvatarUrl;
  String? doctorAvatarUrl;
  List<ChatList>? chatList;

  SingleChatData({this.patientAvatarUrl, this.doctorAvatarUrl, this.chatList});

  SingleChatData.fromJson(Map<String, dynamic> json) {
    if(json["patientAvatarUrl"] is String) {
      patientAvatarUrl = json["patientAvatarUrl"];
    }
    if(json["doctorAvatarUrl"] is String) {
      doctorAvatarUrl = json["doctorAvatarUrl"];
    }
    if(json["chatList"] is List) {
      chatList = json["chatList"] == null ? null : (json["chatList"] as List).map((e) => ChatList.fromJson(e)).toList();
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["patientAvatarUrl"] = patientAvatarUrl;
    _data["doctorAvatarUrl"] = doctorAvatarUrl;
    if(chatList != null) {
      _data["chatList"] = chatList?.map((e) => e.toJson()).toList();
    }
    return _data;
  }
}

class ChatList {
  String? createBy;
  String? createTime;
  String? doctorNo;
  String? patientNo;
  String? initiatorType;
  String? msgContent;
  String? msgType;

  ChatList({this.createBy, this.createTime, this.doctorNo, this.patientNo, this.initiatorType, this.msgContent, this.msgType});

  ChatList.fromJson(Map<String, dynamic> json) {
    if(json["createBy"] is String) {
      createBy = json["createBy"];
    }
    if(json["createTime"] is String) {
      createTime = json["createTime"];
    }
    if(json["doctorNo"] is String) {
      doctorNo = json["doctorNo"];
    }
    if(json["patientNo"] is String) {
      patientNo = json["patientNo"];
    }
    if(json["initiatorType"] is String) {
      initiatorType = json["initiatorType"];
    }
    if(json["msgContent"] is String) {
      msgContent = json["msgContent"];
    }
    if(json["msgType"] is String) {
      msgType = json["msgType"];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["createBy"] = createBy;
    _data["createTime"] = createTime;
    _data["doctorNo"] = doctorNo;
    _data["patientNo"] = patientNo;
    _data["initiatorType"] = initiatorType;
    _data["msgContent"] = msgContent;
    _data["msgType"] = msgType;
    return _data;
  }
}